/*
 * 废弃,因为加载顺序的原因吧,在main.js中引入该文件会报错
 */

import router from '@/router/index'
import { useBreadStore } from '@/stores/breadCrumbs'

router.beforeEach((to, from, next) => {
  const { router_list } = useBreadStore() as any
  if (router_list.some((item: any) => item.path === to.path)) {
    if (to.path !== '/') {
      console.log('首页')
    }
  } else {
    router_list.push(to)
  }
  console.log('权限路由列表', router_list)
  document.title = to.meta.title as string
  next()
})
